package io.renren.modules.business.controller;

import io.renren.modules.business.util.QrCodeUtils;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.util.Map;

import io.renren.common.utils.R;

/**
 *
 * 考勤码管理
 * @author liao mengqing
 */
@RestController
@RequestMapping("business/attendance")
public class BusAttendance {

    @GetMapping("/createQrCode")
    public void createQrCode(HttpServletResponse response) {
        try {
            OutputStream os = response.getOutputStream();
            QrCodeUtils.encode("http://www.baidu.com", "/static/lims.png", os, true);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 添加考勤记录
     * @return
     */
    @PostMapping("/attendance")
    public R attendance(@RequestParam Map<String, Object> params) {
        return R.ok();
    }
}
